package com.dragon.modules.yuegou.mapper.wallet;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dragon.modules.yuegou.entity.wallet.MerchantTradeEntity;
import com.dragon.modules.yuegou.model.wallet.MerchantStatistics;
import com.dragon.modules.yuegou.model.wallet.MerchantTrade;
import com.dragon.modules.yuegou.query.wallet.TradeDetailQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 商户交易（在商户角度的交易流水） Mapper接口
 *
 * @author pbuilder generated
 * @date 2019-06-03 15:20:36
 * @version 2.0
 */
@Component("waltMerchantTradeMapper")
public interface MerchantTradeMapper extends BaseMapper<MerchantTradeEntity> {

    /**
     * 商户账户明细
     * @param page
     * @param busdId
     * @param walletId
     * @param merchantName
     * @param type
     * @param tradeDetailQuery
     * @return
     */
    IPage<MerchantTrade> tradeDetail(IPage page, @Param("busdId") String busdId, @Param("walletId") String walletId, @Param("merchantName") String merchantName, @Param("type") String type,@Param("described")String described, @Param("query") TradeDetailQuery tradeDetailQuery);

    /**
     * 商户账户总入账支出
     * @param busdId
     * @param walletId
     * @param merchantName
     * @param type
     * @param tradeDetailQuery
     * @return
     */
    List<MerchantTrade> tradeTotal( @Param("busdId") String busdId, @Param("walletId") String walletId, @Param("merchantName") String merchantName, @Param("type") String type, @Param("described") String described, @Param("query") TradeDetailQuery tradeDetailQuery);

	List<MerchantTrade> merchantInvoiceList(@Param("merchantTrade") MerchantTrade merchantTrade);

    /**
     * 商户月收入统计
     * */
    MerchantStatistics statistics(@Param("merchantTrade") MerchantTrade merchantTrade);

    /**
     * 商户账户明细
     * @param page
     * @param busdId
     * @param walletId
     * @param merchantName
     * @param type
     * @param orderType
     * @param payType
     * @param processState
     * @param tradeDetailQuery
     * @return
     */
    IPage<MerchantTrade> merchantTradeDetail(IPage page, @Param("busdId")String busdId, @Param("walletId")String walletId,  @Param("merchantName") String merchantName,  @Param("type") String type,  @Param("orderType") String orderType,
                                             @Param("payType") String payType, @Param("processState")String processState, @Param("query")TradeDetailQuery tradeDetailQuery);

    /**
     * 商户账户统计
     * @param busdId
     * @param walletId
     * @param merchantName
     * @param type
     * @param orderType
     * @param payType
     * @param processState
     * @param tradeDetailQuery
     * @return
     */
    MerchantTrade merchantTradeTotal(@Param("busdId")String busdId, @Param("walletId")String walletId,  @Param("merchantName") String merchantName,  @Param("type") String type, @Param("orderType")String orderType,
                                     @Param("payType") String payType, @Param("processState")String processState, @Param("query") TradeDetailQuery tradeDetailQuery);
}
